#ifndef CEditCptH
#define CEditCptH

#include "CtrlStd.h"
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>
#include "CEdit.h"
#include <StdCtrls.hpp>
#include "CtrlStd.h"


extern PACKAGE_CTRLSTD bool __fastcall EstCompteComprisEntre( const AnsiString &strCompte, const AnsiString &strCptA, const AnsiString &strCptB);

typedef AnsiString __fastcall (*TCompleteCompte)( const AnsiString &strCompte);
typedef AnsiString __fastcall (*TTrouveCompte)( const AnsiString &strCompteAbrege);

class PACKAGE_CTRLSTD CEditCompte : public CCustomEdit
{
  private:
    typedef CCustomEdit inherited;

  protected:
    void __fastcall CMExit( TMessage &Msg);

    BEGIN_MESSAGE_MAP
     MESSAGE_HANDLER( CM_EXIT, TMessage, CMExit)
    END_MESSAGE_MAP( inherited)

 private:
  bool   m_bCompleteCompte;
  bool   m_bAccepteCompteAbrege;

  inline AnsiString __fastcall GetCompte( void) /*const*/               { return( inherited::Text);}
  inline void       __fastcall SetCompte( const AnsiString &strCpt) { inherited::Text = strCpt;}

 public:
  static TCompleteCompte CM_CompleteCompte;
  static TTrouveCompte CM_TrouveCompte;

  __fastcall          CEditCompte( TComponent* pOwner);
  __fastcall virtual ~CEditCompte( void)              {};


 public:
  // Nouvelles propriétés
  __property AnsiString Compte = { read = GetCompte, write = SetCompte};

 // Propriétés publiées //
 __published:
  __property AutoSelect;
  __property AutoSize;
  __property BorderStyle;
  __property bool CompleteCompte = { read=m_bCompleteCompte, write=m_bCompleteCompte, default=true };
  __property bool AccepteCompteAbrege = { read=m_bAccepteCompteAbrege, write=m_bAccepteCompteAbrege, default=false };
  __property Width  = { default = 105}; // Permet d'afficher 13 caractères en gras
  __property Ctl3D;
  __property DragCursor;
  __property DragMode;
  __property Enabled;
  __property Filtres;
  __property Font;
  __property HideSelection;
  __property Libelle;
  __property LibelleFont;
  __property ParentCtl3D;
  __property ParentFont;
  __property ParentShowHint;
  __property PopupMenu;
  __property ReadOnly;
  __property ShowHint;
  __property SizeEspace;
  __property TabOrder;
  __property TabStop;
  __property Visible;

 // Evénements non publiés redirigés //
 private:
  void __fastcall OnIllegalChar( CCustomEdit* pedSender, Word& cIllegalCharCode, bool& bAccept);

 // Evénements publiés //
 __published:
  // Evénements hérités (sauf OnIllegal*, OnKey*)
  __property OnChange;
  __property OnClick;
  __property OnDblClick;
  __property OnDragDrop;
  __property OnDragOver;
  __property OnEndDrag;
  __property OnEnter;
  __property OnExit;
  __property OnKeyDown;
  __property OnKeyPress;
  __property OnKeyUp;
  __property OnMouseDown;
  __property OnMouseMove;
  __property OnMouseUp;
  __property OnStartDrag;

 public:
  virtual bool __fastcall IsEmpty( void);
}; /* class CEditCompte */

#endif
